package com.wang.springbootinit.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wang.springbootinit.model.entity.AnswerRecord;
import com.wang.springbootinit.model.vo.AnswerRecordVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface AnswerRecordService extends IService<AnswerRecord> {
    /**
     * 获取学生做题记录
     * @param studentId 学生ID
     * @param subjectId 科目ID
     * @param chapterId 章节ID
     * @return 做题记录列表
     */
    List<AnswerRecordVO> getStudentAnswerRecords(Long studentId, Long subjectId, Long chapterId);
    
    /**
     * 批改学生答题
     * @param recordId 答题记录ID
     * @param isCorrect 是否正确
     * @return 批改结果
     */
    Boolean correctStudentAnswer(Long recordId, Boolean isCorrect);

    /**
     * 学生端-做题记录分页
     * @param chapterId
     * @param questionType
     * @param questionCategory
     * @param current
     * @param pageSize
     * @param request
     * @return
     */
    Page<AnswerRecordVO> getStudentQuestionPage(Long chapterId, Integer questionType, Integer questionCategory, long current, long pageSize, HttpServletRequest request);

    /**
     * 学生端-删除答题记录
     * @param id
     * @param request
     * @return
     */
    Boolean deleteAnswerRecord(Long id, HttpServletRequest request);

    /**
     * 学生端-获取错题分页
     * @param chapterId
     * @param questionType
     * @param questionCategory
     * @param current
     * @param pageSize
     * @param request
     * @return
     */
    Page<AnswerRecordVO> getStudentErrorQuestionPage(Long chapterId, Integer questionType, Integer questionCategory, long current, long pageSize, HttpServletRequest request);
}